package io.bdmc.modules.bss.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 设备报警 实体
 * </p>
 *
 * @author ping
 * @since 2020-07-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@NoArgsConstructor
// "DeviceAlarm对象", description = "设备报警")
public class DeviceAlarmMask extends Model<DeviceAlarmMask> {

    private static final long serialVersionUID = 1L;

    // "自增id")
    @TableId(value = "mask_id", type = IdType.AUTO)
    private Integer maskId;

    // "部门id")
    private Integer deptId;

    // "设备id")
    private Integer deviceId;

    private String deviceSn;

    // "报警编码")
    private String alarmTypeCode;

    private Integer alarmTypeId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    //设备名称
    @TableField(exist = false)
    private String deviceName;

    // 报警名称
    @TableField(exist = false)
    private String alarmTypeName;

    //设备标签
    @TableField(exist = false)
    private String deviceDigest;


    @Override
    public Serializable pkVal() {
        return this.maskId;
    }

}
